package cn.tedu.boot1.controller;

import cn.tedu.boot1.entity.Emp;
import cn.tedu.boot1.entity.Hero;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ParamController {

    @RequestMapping("/p1")
    @ResponseBody

    public String p1(String info) {
        return "接受了数据" + info;
    }

    /*        @RequestMapping("/p2")
            @ResponseBody

            public String p2(String name,float salary,String job){
                return "姓名:"+name+"\t"+"工资:"+salary+"\t"+"工作:"+job;
            }*/
    @RequestMapping("/p2")
    @ResponseBody

    public String p2(Emp emp) {
        return emp.toString();
    }

    @RequestMapping("/p3")

    public String p3(Hero hero) {
        return hero.toString();
    }

}
